using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class sp_ph_expiredMap : EntityTypeConfiguration<sp_ph_expired>
    {
        public sp_ph_expiredMap()
        {
            // Primary Key
            this.HasKey(t => new { t.DESC, t.ACCT, t.CURRENCY, t.TYPEGEN, t.HeaderAcct, t.ACCTID });

            // Properties
            this.Property(t => t.DESC)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.TYPE)
                .HasMaxLength(2);

            this.Property(t => t.CLASS)
                .HasMaxLength(1);

            this.Property(t => t.BDGTCAT)
                .HasMaxLength(2);

            this.Property(t => t.ACCT)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.PARENT)
                .HasMaxLength(40);

            this.Property(t => t.CURRENCY)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.TYPEGEN)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            this.Property(t => t.SubAcct)
                .HasMaxLength(35);

            this.Property(t => t.ACCTID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            // Table & Column Mappings
            this.ToTable("sp_ph_expired");
            this.Property(t => t.DESC).HasColumnName("DESC");
            this.Property(t => t.BEGDR).HasColumnName("BEGDR");
            this.Property(t => t.BEGDRDOL).HasColumnName("BEGDRDOL");
            this.Property(t => t.BEGCR).HasColumnName("BEGCR");
            this.Property(t => t.BEGCRDOL).HasColumnName("BEGCRDOL");
            this.Property(t => t.OLDDR).HasColumnName("OLDDR");
            this.Property(t => t.OLDDRDOL).HasColumnName("OLDDRDOL");
            this.Property(t => t.OLDCR).HasColumnName("OLDCR");
            this.Property(t => t.OLDCRDOL).HasColumnName("OLDCRDOL");
            this.Property(t => t.CURDR).HasColumnName("CURDR");
            this.Property(t => t.CURDRDOL).HasColumnName("CURDRDOL");
            this.Property(t => t.CURCR).HasColumnName("CURCR");
            this.Property(t => t.CURCRDOL).HasColumnName("CURCRDOL");
            this.Property(t => t.OLDDRYA).HasColumnName("OLDDRYA");
            this.Property(t => t.OLDDRYADOL).HasColumnName("OLDDRYADOL");
            this.Property(t => t.OLDCRYA).HasColumnName("OLDCRYA");
            this.Property(t => t.OLDCRYADOL).HasColumnName("OLDCRYADOL");
            this.Property(t => t.CURDRYA).HasColumnName("CURDRYA");
            this.Property(t => t.CURDRYADOL).HasColumnName("CURDRYADOL");
            this.Property(t => t.CURCRYA).HasColumnName("CURCRYA");
            this.Property(t => t.CURCRYADOL).HasColumnName("CURCRYADOL");
            this.Property(t => t.TYPE).HasColumnName("TYPE");
            this.Property(t => t.CLASS).HasColumnName("CLASS");
            this.Property(t => t.BDGTCAT).HasColumnName("BDGTCAT");
            this.Property(t => t.ACCT).HasColumnName("ACCT");
            this.Property(t => t.PARENT).HasColumnName("PARENT");
            this.Property(t => t.CURRENCY).HasColumnName("CURRENCY");
            this.Property(t => t.BEGDRACCT).HasColumnName("BEGDRACCT");
            this.Property(t => t.BEGCRACCT).HasColumnName("BEGCRACCT");
            this.Property(t => t.OLDDRACCT).HasColumnName("OLDDRACCT");
            this.Property(t => t.OLDCRACCT).HasColumnName("OLDCRACCT");
            this.Property(t => t.CURDRACCT).HasColumnName("CURDRACCT");
            this.Property(t => t.CURCRACCT).HasColumnName("CURCRACCT");
            this.Property(t => t.OLDDRYAACT).HasColumnName("OLDDRYAACT");
            this.Property(t => t.OLDCRYAACT).HasColumnName("OLDCRYAACT");
            this.Property(t => t.CURDRYAACT).HasColumnName("CURDRYAACT");
            this.Property(t => t.CURCRYAACT).HasColumnName("CURCRYAACT");
            this.Property(t => t.TYPEGEN).HasColumnName("TYPEGEN");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
            this.Property(t => t.HeaderAcct).HasColumnName("HeaderAcct");
            this.Property(t => t.CreationDate).HasColumnName("CreationDate");
            this.Property(t => t.Lastupdate).HasColumnName("Lastupdate");
            this.Property(t => t.vatacct).HasColumnName("vatacct");
            this.Property(t => t.HeaderID).HasColumnName("HeaderID");
            this.Property(t => t.SubAcct).HasColumnName("SubAcct");
            this.Property(t => t.level).HasColumnName("level");
            this.Property(t => t.ACCTID).HasColumnName("ACCTID");
        }
    }
}
